I have two projects, and in one, this code yields no error:
form: FormGroup = new FormGroup({
s: new FormControl('')
})
fo$ = this.form.get('s').valueChanges.pipe(
map(a => console.log('something'))
);
But in my new project, this brings up the error "Object is possibly 'null'." How can I solve this?
It's probably the case where you have strict mode enabled in one project, and disabled in other project.
Go to the tsconfig.json file and disable strict mode in the project where it's enabled.